home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / checkbox / registries / dmi.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2009-11-11  |  1KB  |  28 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import posixpath
  5. from checkbox.lib.cache import cache
  6. from checkbox.properties import String
  7. from checkbox.registries.command import CommandRegistry
  8.  
  9. class DmiRegistry(CommandRegistry):
  10.     '''Registry for dmi information.'''
  11.     command = String(default = 'grep -r . /sys/class/dmi/id/ 2>/dev/null || true')
  12.     
  13.     def items(self):
  14.         items = []
  15.         for line in str(self).split('\n'):
  16.             if not line:
  17.                 continue
  18.             
  19.             (path, value) = line.split(':', 1)
  20.             key = posixpath.basename(path)
  21.             items.append((key, value))
  22.         
  23.         return items
  24.  
  25.     items = cache(items)
  26.  
  27. factory = DmiRegistry
  28.